#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>

int hammingWeight(uint32_t n)
{
    int count = 0;
    while (n != 0) {
        n &= (n - 1);
        count++;
    }
    return count;
}

int main(int argc, char const *argv[])
{
    uint32_t a = 0xff0f;
    int r = hammingWeight(a);
    printf("%d\n", r);
    return 0;
}
